<template>
  <div class="app-container">

    <!--列表数据  -->
    <el-table :data="list" border fit highlight-current-row style="width: 100%;">
      <el-table-column label="真实姓名" prop="realName" align="center"/>
      <el-table-column label="手机号" prop="phone" align="center">
        <template scope="scope">
          <span>{{scope.row.phone?scope.row.phone:'暂无绑定手机号'}}</span>
        </template>
      </el-table-column>

      <el-table-column label="微信号" prop="wxNumber" align="center">
        <template scope="scope">
          <span>{{scope.row.wxNumber?scope.row.wxNumber:'暂无绑定微信号'}}</span>
        </template>
      </el-table-column>

      <el-table-column label="是否为工程师" prop="isEngineer" align="center">
        <template slot-scope="scope">
          <span>{{scope.row.isEngineer==0?'否':'是'}}</span>
        </template>
      </el-table-column>

      <el-table-column label="注册时间" prop="regTime" align="center"/>

    </el-table>
    <!-- 底部分页 -->
    <pagination v-show="count > 0" align="center" :total="count" :page.sync="listQuery.page"
                :limit.sync="listQuery.size" @pagination="getList(listQuery.page,listQuery.size)"/>



  </div>
</template>
<script>
  // 后台接口数据
  import {getUserList} from '@/api/user'
  import Pagination from '@/components/Pagination'
  export default {
    name: 'userList',
    components: {Pagination},
    data() {
      return {
        listQuery:{
          page:1,
          size:10
        },
        count:0,
        list:[]
      }
    },

    created() {
    this.getList(1,10)
    },

    methods: {

      getList(page, size) {
      var params = {
        page: page,
        size: size,
      }
      // 得到所有用户的接口
        getUserList(params).then(res => {
          this.list = res.data
          this.count = res.count
          this.listQuery.page=page
          this.listQuery.size=size
        })
        .catch(err => {
        })
    }











    }
  }
</script>
<style>


</style>

